package com.zb.framework.test.utils;

/**
 * @author fujianjian
 * @since 2021/7/5 9:24
 */
public class CodeGenerator {

    /**
     * 代码生成的模块名
     */
    public static String CODE_NAME = "自定义模块";
    /**
     * 代码所在服务名
     */
    public static String SERVICE_NAME = "zb-framework-test";
    /**
     * 代码生成的包名
     */
    public static String PACKAGE_NAME = "com.zb.framework";
    /**
     * 前端代码生成所属系统
     */
    public static String SYSTEM_NAME = "sword";
    /**
     * 生产项目包的父路径
     */
    public static String PAGE_DIR = "zb-test";

    public static String SUPER_ENTITY_CLASS = "com.zb.framework.model.BaseEntity";

    /**
     * 需要去掉的表前缀
     */
    public static String[] TABLE_PREFIX = {"t_"};
    /**
     * 需要生成的表名(两者只能取其一)
     */
    public static String[] INCLUDE_TABLES = {"t_sys_login"};
    /**
     * 需要排除的表名(两者只能取其一)
     */
    public static String[] EXCLUDE_TABLES = {};
    /**
     * 是否包含基础业务字段
     */
    public static Boolean HAS_SUPER_ENTITY = Boolean.FALSE;
    /**
     * 基础业务字段
     */
    public static String[] SUPER_ENTITY_COLUMNS = {
            "id", "creator", "creator_name",
            "last_updator", "last_updator_name", "last_update_time",
            "version",
            "create_time", "create_user", "update_time",
            "update_user", "status", "is_deleted"};

    /**
     * RUN THIS
     */
    public static void main(String[] args) {
        ZBCodeGenerator generator = new ZBCodeGenerator();
        generator.setCodeName(CODE_NAME);
        generator.setServiceName(SERVICE_NAME);
        generator.setSystemName(SYSTEM_NAME);
        generator.setPackageName(PACKAGE_NAME);
        generator.setTablePrefix(TABLE_PREFIX);
        generator.setIncludeTables(INCLUDE_TABLES);
        generator.setExcludeTables(EXCLUDE_TABLES);
        generator.setSuperEntityClass(SUPER_ENTITY_CLASS);
        generator.setHasSuperEntity(HAS_SUPER_ENTITY);
        generator.setPackageDir(PAGE_DIR);
        generator.setSuperEntityColumns(SUPER_ENTITY_COLUMNS);
        generator.run();
    }
}
